package com.itheima.service.impl;

import com.github.pagehelper.PageHelper;
import com.itheima.mapper.UserMapper;
import com.itheima.pojo.UserInfo;
import com.itheima.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public UserInfo findOne(Integer id) {
        return userMapper.findById(id);
    }

    @Override
    public List<UserInfo> findAll() {
        PageHelper.startPage(1, 2);
        return userMapper.findAll();
    }
}
